package com.Logistics.BaseFeign;

import com.Logistics.dto.TaskTransportDto;
import com.Logistics.entity.TransportOrder;
import com.Logistics.vo.TransportVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "pd-work", path = "/transport")
public interface TransportFeignClient {

    /**
     * 根据订单id查询运单信息
     * @param ids 订单编号
     * @return 运单结果集
     */
    @PostMapping("/findByOrderIds")
    public TransportOrder findByOrderIds(@RequestParam("ids") String ids);

    /**
     * 根据订单id集合查询运单结果集
     *
     * @param ids 订单id集合
     * @return 运单结果集
     */
    @PostMapping("/findByOrderIdsList")
    public List<TransportOrder> findByOrderIdsList(@RequestParam(name = "ids") List<String> ids);

    /**
     * 根据运输id获取运单列表
     * @param id 运输任务编号
     * @return 运单列表
     */
    @PostMapping("/ObtainWaybillBasedOnTransportationID")
    public List<TransportVo> ObtainWaybillBasedOnTransportationID(@RequestParam("id") String id) ;

    /**
     * 创建运输任务并绑定运单
     * @param taskTransportDto
     * @return
     */
    @PostMapping("/createTask_transport")
    public TaskTransportDto createTaskTransport(@RequestBody TaskTransportDto taskTransportDto);
}
